package small.common.core.util;

public class ClassUtil {

    /**
     * CGLIB代理名称
     */
    public static final String CGLIB_CLASS_SEPARATOR = "$$";



    public static ClassLoader getDefaultClassLoader() {
        ClassLoader cl = null;
        try {
            //获取当前线程类加载器
            cl = Thread.currentThread().getContextClassLoader();
        } catch (Throwable ex) {
            //无法访问线程上下文ClassLoader-返回到系统类加载器
        }
        if (cl == null) {
            // 获取当前类类加载器
            cl = ClassUtil.class.getClassLoader();
        }
        //获取系统类加载器
        if (cl == null) {
            cl = ClassLoader.getSystemClassLoader();
        }
        return cl;
    }
}
